<!doctype html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>指令v-on</title>
</head>
<body>
    <div id="example-4">
        <button type="button" v-on:click="exampleMethod()">{{text}}</button>
    </div>


<script src="../lib/vue.js"></script>
<script>
    /*
    * vue.js另一个v-on指令，用来监听DOM事件
    * v-on:click,v-on:keyup.enter
    * */
    var exampleVm = new Vue({
        el : "#example-4",
        data : {
            text : "click me!"
        },
        methods : {
            exampleMethod : function(){
                alert('你点击我了！');
            }
        }
    })
</script>
</body>
</html>